from numpy import *
from scipy import optimize
 
def gaussian(height, center_x, center_y, width_x, width_y):
     """Returns a gaussian function with the given parameters"""
     width_x = float(width_x)
     width_y = float(width_y)
     return lambda x,y: height*exp(
                 -(((center_x-x)/width_x)**2+((center_y-y)/width_y)**2)/2)
    
from pylab import *
# Create the gaussian data
Xin, Yin = mgrid[0:201, 0:201]
data = gaussian(1, 100, 100, 3.5, 3.8)(Xin, Yin)
data = data/data.sum()
subdata=data[:, 90:110]
print subdata.sum()
